home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / utilitys / findisk3 / part01 / FindDisk2.doc < prev    next >
Text File  |  1991-11-20  |  9KB  |  275 lines

  1.  
  2.   FindDisk2.3
  3.  
  4.   A Public Domain Program by Ross MacGregor.
  5.  
  6.   The source was compiled with the Manx compiler (.
  7.   (but can be compiled with Lattice with a small effort)
  8.  
  9.   /*  Anxious?  Then skip ahead to Getting Started. */
  10.  
  11.   Most people that own Amiga's soon accumulate a *GREAT* collection of
  12.   3-&-1/2 '' disks filled with lots and lots of PD software.  And I'm sure
  13.   that many people still go through the same time-consuming process I use to
  14.   when finding a certain program  [ I think it's on this disk...no maybe this
  15.   one...lets try this one...it must be here...I guess not...argggh! $#@#%! ].
  16.  
  17.   If you have been looking to organize your disks a little better, this may
  18.   be just what you need.  I have seen other disk cataloging programs but
  19.   they looked BIG and complicated.
  20.  
  21.  
  22.   I wanted a simple, unintrusive CLI command that would tell me on what disk
  23.   such-n-such a program could be found.
  24.  
  25.   So here it is, (ta-da) FD for FindDisk of course (now vers 2.3) .
  26.  
  27.   I made extensive revisions to how it operates and hope it is now much
  28.   easier to use.
  29.  
  30.   Type> FD       ;  And you will get a summary of available commands
  31.  
  32.  
  33.   Type> FD text  ;  And the disk's directory listing containing 'text'
  34.                     is displayed just as if you had done an ls.
  35.                     The text could also be the name of the disk.
  36.  
  37.                     Multiple arguments can also be given so that the
  38.                     directory, ARP_COMMANDS_DOC could be found with,
  39.                     FD doc arp.
  40.  
  41.  
  42.   The DiskList
  43.  
  44.   FD uses a file which by default is FindDisk:DiskList.  You will
  45.   either have to set the environment variable DLDISK or assign
  46.   'FindDisk:'to the appropriate directory so FD can find this file.
  47.  
  48.   FindDisk:DiskList is an almost ASCII file containing the listings of
  49.   your disks.
  50.  
  51.   [clarification of almost...]
  52.  
  53.   To save space the listings are stored with the spaces ($20's) compacted
  54.   and some words of the listing tokenized.
  55.   This results in a file with many special (non-standard) control
  56.   characters.  It will not TYPE properly!
  57.  
  58.   The DiskList can be loaded to ram: (yes, it's just a COPY but its also an
  59.   FD command, FD -load ).  This enables single drive users to capture the
  60.   dir listings of other disks.  It frees up the drive and also speeds
  61.   things up if the DiskList gets large.
  62.  
  63.  
  64.   TempDL
  65.  
  66.   When you capture the directory listing of a disk (FD -dir) it goes to an
  67.   intermediate file, TempDL, instead of going directly to DiskList
  68.   (basically it's a Shell> dir >>TempDL ).  This is for reasons of more
  69.   efficient updating of the DiskList.  If someone had many disks to do,
  70.   inserting the directories into DiskList one at a time would take much
  71.   longer than inserting them all at once as FD does.  Single drive users
  72.   would also need to reinsert their DiskList disk after each FD -d.  You
  73.   must do an  FD -update or FD -savedl to update the DiskList.
  74.  
  75.   FD -update will update the current DiskList.  If DiskList was loaded to
  76.   ram: the current one is considered there, otherwise it updates the disk
  77.   DiskList.
  78.  
  79.   FD -savedl will copy the ram:DiskList to its disk location after doing
  80.   an update (as above).  If the current DiskList is not in RAM it will only
  81.   do an update.
  82.  
  83.  
  84.  
  85.                             FindDisk2.3
  86.                           ---------------
  87.  
  88.   Syntax : FD   <-l>  |  <-s>  |  <-u>  |  <-r volname>  |
  89.                 <-d [path]>  |  <-a [path]>  |  <-n>  |
  90.                 <[!]text1 [!]text2 ... [!]textn>
  91.  
  92.   > fd -l       Loads DiskList to ram: by default or to an alternate
  93.                 path/name if specified by the environment variable DLTEMP .
  94.                 The DiskList in RAM then becomes the current DiskList.
  95.                 DiskList must be now be saved to disk (FD -save) if any
  96.                 changes are made  because FD -update will only update the
  97.                 RAM DiskList.
  98.  
  99.  
  100.   > fd -d [path]
  101.                 To add a disk listing to the DiskList. Appends in
  102.                 ram:TempDL the ASCII (root) dir listing of the disk in
  103.                 drive DF0: by default.  It takes it from an alternate drive
  104.                 if specified by the environment variable DLDRIVE.  You can
  105.                 now also specify drive or directory path as a second
  106.                 argument to fd.
  107.  
  108.  
  109.   > fd -a [path]
  110.                 Same as above but captures sub-directories also (all of the
  111.                 disk).
  112.  
  113.  
  114.   > fd -u       FD with the u option will update the current DiskList with
  115.                 the contents of the temporary file TempDL.
  116.  
  117.   > fd -s       Does an update (as above) then, if the DiskList is in RAM,
  118.                 it is copied to its disk location.  DiskList and TempDL are
  119.                 removed from RAM.
  120.  
  121.   > fd -n       Creates a new DiskList, by deleting the contents of the
  122.                 Current DiskList.
  123.  
  124.   > fd -r diskname
  125.  
  126.       This will remove the disk listing in DiskList that matches 'diskname'.
  127.  
  128.   > fd arg1 arg2 ... argn
  129.  
  130.        If the arguments for FD are all found on the same line of a directory
  131.        listing in the DiskList then that dir listing is printed.
  132.  
  133.        If the search text is preceded with an ! with no spaces in between
  134.        then the search is case sensitive otherwise it is not.
  135.  
  136.        The disk name can also be used to list its contents.
  137.  
  138.  
  139.  
  140.                       Environment Variables
  141.                       ---------------------
  142.  
  143.   You should have env: assigned before invoking FD or else you will get an
  144.   annoying requester asking to insert volume env:.  Env: can be ASSIGN'ed
  145.   to RAM: if you do not want to create the standard ram:env directory.
  146.   [ Yes, this could have been circumvented but at the expense of larger
  147.     code!  I opted not to add it since assigning env: from the CLI is a
  148.     trivial matter. ]
  149.  
  150.   FD will check for the three environment variables listed below.
  151.  
  152.   *Notice* that DLDISK and DLTEMP require the name of DiskList also!
  153.  
  154.   Variable = Default setting if not specified.
  155.  
  156.   DLDISK   =  FindDisk:Disklist
  157.   ------
  158.            Disk storage location/name.  This is where FD expects to find
  159.            the permanent DiskList.  It must be on a floppy or hard drive.
  160.  
  161.   DLTEMP   =  ram:DiskList
  162.   ------
  163.            Ram storage location/name.  This is where FD will copy the
  164.            permanent DiskList to on an FD -load.  This makes the DiskList
  165.            resident and frees up the drive.
  166.  
  167.   DLDRIVE  =  df0:
  168.   -------
  169.            Captures dir of this drive on a FD -dir command.
  170.  
  171.  
  172.  
  173.  
  174.                          Getting Started
  175.                          ---------------
  176.  
  177.   Assign DiskList to this directory.
  178.  
  179.   Type> assign FindDisk: dfx:FindDisk     ;(x=whatever drive you're in)
  180.  
  181.   Type> fd
  182.  
  183.   Hopefully this help screen provided will be all you ever need to refer
  184.   to in the future.
  185.  
  186.   Type> fd :
  187.  
  188.   This displays all disks in the DiskList [if there is an example one
  189.   provided].  It displays all of them because there is always a colon in
  190.   every volume name.
  191.  
  192.   Type> fd -l
  193.  
  194.   The DiskList will be loaded to ram:.
  195.  
  196.   Type> fd -n
  197.  
  198.   Respond 'y' to the prompt.  Now you have a new (empty) DiskList in ram:.
  199.  
  200.   Place any disk in drive df0:.
  201.  
  202.   Type> fd -d
  203.  
  204.   The root directory of this disk is captured.
  205.   Do this for several disks if you wish.
  206.  
  207.   Put the disk which contains FindDisk back in the drive.
  208.  
  209.   Type> fd -s
  210.  
  211.   Your new DiskList is updated and saved to disk.
  212.  
  213.   Type> fd :
  214.  
  215.   You should now get all your disks listed.
  216.  
  217.   Type> fd <disk name>
  218.  
  219.   This disk listing is displayed if it is in your DiskList.
  220.  
  221.   Type> fd <name of a program>
  222.  
  223.   The disk listing containing this program or directory is displayed.
  224.  
  225.   Simple as that!
  226.  
  227.  
  228.                          DiskList Format
  229.                          ---------------
  230.  
  231.    The DiskList is stored in a compacted form which presently:
  232.  
  233.      below: { unskrunched } => { skrunched }
  234.             [] is a byte of memory
  235.  
  236.      * compacts strings of spaces
  237.          { [$20] [$20] [$20] [$20] [$20] } => { [SKRUNCHAR] [30+5] }
  238.          { [$20] [$20] } => { [$20] [$20] }
  239.  
  240.      * the STARTSTR is compacted
  241.          { STARTSTR } => { [STARTCHAR] }
  242.  
  243.  
  244.  
  245.                     BUG FIXES / UPDATE HISTORY
  246.                     --------------------------
  247.  
  248.    FindDisk2.3   Function getstr() was not freeing all of its allocated
  249.                  memory.
  250.  
  251.                  Use of strncpy() was causing problems because of padding.
  252.  
  253.                  Remove limit of DiskList size (it was a fair size but
  254.                  unnecessary).
  255.  
  256.    FindDisk2.2   Output now sent to stdout for redirection and piping
  257.                  to work properly.
  258.  
  259.                  Environment variable DLDISK now defaults to
  260.                  FindDisk:DiskList.
  261.  
  262.    FindDisk2.1   Option -a created to capture all sub-directories on
  263.                  a given disk when adding it to the DiskList.
  264.  
  265.                  A sub-directory can now be specified as a parameter
  266.                  to the -d and -a options.
  267.  
  268.                  Some 2.0 error returns were not propery freeing up
  269.                  allocated resouces.  These were accordingly squashed.
  270.  
  271.    FindDisk2.0   First release.
  272.  
  273.  
  274.  
  275.